/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.expert.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.validator.constraints.Length;

import com.chlitina.store.common.persistence.BaseEntity;

/**
 * 条件方案Entity
 * @author liujiang
 * @version 2013-06-07
 */
@Entity
@Table(name = "expert_experience_basic_solution")
@IdClass(MinMaxValuePK.class)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class ExpertExperienceBasic extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private Long min_value; // 范围
	private Long max_value; // 范围
	private String skin_type; 		// 肤质类型
	private SolutionFace solutionFace; 		// 对应基础护理方案
	
	public ExpertExperienceBasic() {
		
	}
	
	@Id
	public Long getMin_value() {
		return min_value;
	}


	public void setMin_value(Long min_value) {
		this.min_value = min_value;
	}

	@Id
	public Long getMax_value() {
		return max_value;
	}


	public void setMax_value(Long max_value) {
		this.max_value = max_value;
	}
	
	@Length(min=1, max=64)
	public String getSkin_type() {
		return skin_type;
	}

	public void setSkin_type(String skin_type) {
		this.skin_type = skin_type;
	}
	
	@OneToOne(cascade=CascadeType.REFRESH, fetch = FetchType.LAZY)
	@JoinColumn(name="solution_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public SolutionFace getSolutionFace() {
		return solutionFace;
	}

	public void setSolutionFace(SolutionFace solutionFace) {
		this.solutionFace = solutionFace;
	}
}


